home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 November / macformat-018.iso / Utility Spectacular / Compression / StuffIt InstallerMaker™ Folder / InstallerMaker Extensions / IBeg Extension / SendInCardIBeg.p < prev    next >
Encoding:
Text File  |  1993-07-01  |  2.4 KB  |  73 lines  |  [TEXT/MPS ]

  1. (* ****************************************************************
  2.  
  3.         SendInCardIBeg.p
  4.                     Written in MPW Pascal by Darryl Lovato (dgl).
  5.                     
  6.         Copyright © 1993 Aladdin Systems, Inc.
  7.         All Rights Reserved.
  8.         
  9.         In combination with the associated make file
  10.         (SendInCardIBeg.make), this source text produces an IBeg
  11.         installer extension, which can be called by a Product
  12.         Installer at the start of the installation process.
  13.         Specifications for IBeg, IMid, ICnd, and IEnd installer
  14.         extensions are given in the documentation for StuffIt
  15.         InstallerMaker™.
  16.         
  17.         WARNING:  THE IBegAndSound RESOURCE FILE, INCLUDED IN THE
  18.         INSTALLERMAKER PRODUCT SUITE, CONTAINS BOTH THE EXECUTABLE
  19.         CODE RESOURCE AND ITS ASSOCIATED SOUND RESOURCE.  THE RESOURCE
  20.         FILE PRODUCED BY SendInCardIBeg.make (SendInCardIBeg), CONTAINS
  21.         THE CODE RESOURCE ONLY.  YOU MUST USE RESEDIT OR A SIMILAR
  22.         UTILITY TO EXTRACT THE SOUND RESOURCE FROM IBegAndSound AND
  23.         MERGE IT INTO THE SendInCardIBeg IBEG CODE RESOURCE FILE.  THE
  24.         RESULTING, MERGED FILE CAN BE USED AS AN INCLUDED RESOURCE FILE
  25.         BY THE INSTALLERMAKER PROGRAM.
  26.         
  27.         This subroutine performs the following functions:
  28.            
  29.         • Loads and plays the snd=128 resource in the Product
  30.           Installer's resource fork, using the SndPlay call.
  31.         • Returns status code from SndPlay.
  32.         
  33.         CHANGE HISTORY:
  34.         
  35.         VER    DATE        ENGR    DESCRIPTION
  36.         1    93.06.21    dgl        Initial version.
  37.         2    93.06.22    jam        Added commentary and modified style to
  38.                                 match other source files in the
  39.                                 InstallerMaker suite.
  40.         3    93.06.28    jam        Changed DoBeforeInstalling declaration
  41.                                 to conform to new pw parameter spec.
  42.  
  43. ****************************************************************** *)
  44.  
  45. (*$Z+*) (*    Allows linker to find DoBeforeInstalling without
  46.             declaring it in the interface *)     
  47. UNIT IBeg;
  48.  
  49. INTERFACE
  50.  
  51. IMPLEMENTATION
  52.  
  53.    USES
  54.      Types,
  55.      Sound,
  56.      Resources;
  57.  
  58.   FUNCTION DoBeforeInstalling(VAR pw: str255): INTEGER;
  59.     VAR
  60.       theSound : Handle;
  61.   BEGIN (* DoBeforeInstalling *)
  62.     (* Get the sound!  We can assume the current resource file
  63.        is the Product Installer. *)
  64.     theSound := GetResource('snd ',128);
  65.     
  66.     (* Now play it.  If SndPlay returns noErr, then installation
  67.        will continue, otherwise installation will stop. *)
  68.     DoBeforeInstalling := SndPlay(nil,theSound,false);
  69.     
  70.     (* Clean up the world before departing. *)
  71.     ReleaseResource(theSound);
  72.   END (* DoBeforeInstalling *);
  73. END (* IBeg *).